]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Fix a warning
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 1 Feb 2013 00:22:15 +0000 (01:22 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 1 Feb 2013 12:06:00 +0000 (13:06 +0100)
While we handle the case where ibus_bus_get_global_engine() returns
NULL, this case actually generates an exception we have to catch to
avoid some (harmless) console spam.

https://bugzilla.gnome.org/show_bug.cgi?id=692995

js/ui/status/keyboard.js

index f0914184666981b4fdec9254718997fe36e801eb..15e14d83a3fcac8756d4d6ae098062a6f3260553 100644 (file)
@@ -115,9 +115,14 @@ const IBusManager = new Lang.Class({
             this._panelService.connect('update-property', Lang.bind(this, this._updateProperty));
             // If an engine is already active we need to get its properties
             this._ibus.get_global_engine_async(-1, null, Lang.bind(this, function(i, result) {
-                let engine = this._ibus.get_global_engine_async_finish(result);
-                if (!engine)
+                let engine;
+                try {
+                    engine = this._ibus.get_global_engine_async_finish(result);
+                    if (!engine)
+                        return;
+                } catch(e) {
                     return;
+                }
                 this._engineChanged(this._ibus, engine.get_name());
             }));
             this._updateReadiness();